package com.ocean.controller.library;

import com.ocean.entity.library.LibraryCard;
import com.ocean.service.library.LibraryCardService;
import com.ocean.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Project：SchoolManage
 * Package：com.ocean.controller.library
 * Author:zy
 * Time:2023/3/3
 */

@RestController
@RequestMapping("/api/library/card")
public class LibraryCardController {
    @Autowired
    private LibraryCardService libraryCardService;

    @RequestMapping("save.do")
    public R save(@RequestBody LibraryCard libraryCard){
        return libraryCardService.save(libraryCard);
    }

    @RequestMapping("del.do")
    public R del(int id){
        return libraryCardService.del(id);
    }

    @RequestMapping("update.do")
    public R update(@RequestBody LibraryCard libraryCard){
        return libraryCardService.update(libraryCard);
    }


    @RequestMapping("querypage.do")
    public R queryPage(int page,int size){
        return libraryCardService.queryPage(page, size);
    }

    @RequestMapping("selectIdByName.do")
    public R selectIdByName(String name){
        return libraryCardService.selectIdByName(name);
    }
}
